package Test;

import java.util.Arrays;
import java.util.Scanner;

public class TTT5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] line1 = sc.nextLine().split(" ");
        int length = Integer.parseInt(line1[0]);
        int index = Integer.parseInt(line1[1]);
        String input = sc.nextLine();
        char[] arr = input.toCharArray();
        for (int i = 0; i < length; i++) {
            char cur = arr[i];
             if (i < index){
                 //变大写
                 if (cur >= 97){
                    arr[i] = (char) (cur - 32);
                 }
             }else {
                 //变小写
                 if (cur <= 90){
                     arr[i] = (char) (cur + 32);
                 }
             }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }
    }
}
